package com.eastfair.builder;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.builder.dto.ExhibitorDTO;
import com.eastfair.builder.vo.ExhibitorVO;
import com.eastfair.core.base.R;
import com.eastfair.venueservice.dto.ServiceProviderSpaceQuery;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 展商 Feign.
 *
 * @author dqq
 * @date 2022 /8/15
 */
@FeignClient(value = "builder/exhibitor")
public interface ExhibitorFeign {

    /**
     * 查询展商VO列表.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the r
     */
    @PostMapping("/query/exhibitor")
    R<List<ExhibitorVO>> queryExhibitors(@RequestBody ExhibitorDTO exhibitorDTO);

    /**
     * 通过展会，主场，展厅查询展位
     *
     * @param query
     * @return the r
     */
    @PostMapping("/query/providerSite")
    R<Page<ExhibitorVO>> queryServiceProviderSite(@RequestBody PageParams<ExhibitorDTO> query);

    /**
     * 通过展会查询展位
     *
     * @param query
     * @return the r
     */
    @PostMapping("/queryAllServiceProviderSite")
    R<List<ExhibitorVO>> queryAllServiceProviderSite(@RequestBody ServiceProviderSpaceQuery query);

    /**
     * 查询展商VO列表.
     *
     * @param id the id
     * @return the exhibitor
     */
    @ApiOperation("查询展商VO列表")
    @GetMapping("/get/{id}")
    R<ExhibitorVO> getExhibitor(@PathVariable("id") Long id);

    /**
     * 修改参展商.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the r
     */
    @PostMapping("/update")
    R<Boolean> updateExhibitor(@RequestBody ExhibitorDTO exhibitorDTO);

    /**
     * 展位重置.
     *
     * @param id the id
     * @return the r
     */
    @GetMapping("/reset/{id}")
    R<Boolean> updateIsReset(@PathVariable("id") Long id);

    /**
     * 更新展商应付保证金金额.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the r
     */
    @PostMapping("/update/shouldEarnestMoney")
    R<Boolean> updateShouldEarnestMoney(@RequestBody ExhibitorDTO exhibitorDTO);

    /**
     * 更新保证金支付状态.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the r
     */
    @PostMapping("/update/earnestMoney/payStatus")
    R<Boolean> updateEarnestMoneyPayStatus(@RequestBody ExhibitorDTO exhibitorDTO);

    /**
     * 更新保证金余额.
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the r
     */
    @Deprecated
    @PostMapping("/update/remainEarnestMoney")
    R<Boolean> updateRemainEarnestMoney(@RequestBody ExhibitorDTO exhibitorDTO);

    /**
     * 批量移除展商.
     *
     * @param ids the ids
     * @return the r
     */
    @PostMapping("/remove")
    R<Boolean> removeByIds(@RequestBody List<Long> ids);

    /**
     * 保存参展商(仅展商表).
     *
     * @param exhibitorDTO the exhibitor dto
     * @return the r
     */
    @ApiOperation("保存参展商(仅展商表)")
    @PostMapping("/saveExhibitorOnlyExhibitor")
    R<Boolean> saveExhibitorOnlyExhibitor(@RequestBody List<ExhibitorDTO> exhibitorDTO);
}